

#include <math/plane.h>
#include <math/vector.h>


cePlane::cePlane (const ceVector3f &p0, const ceVector3f &p1, const ceVector3f &p2)
{
  ceVector3f n = (p2 - p0) % (p1 - p0);
  n.Normalize();
  _x = n.x;
  _y = n.y;
  _z = n.z;
  _d = -p0.Dot(n);
}

cePlane::cePlane(const ceVector3f &n, const ceVector3f &p)
{
  ceVector3f nn = n.Normalized();
  _x = nn.x;
  _y = nn.y;
  _z = nn.z;
  _d = -p.Dot(nn);

}

